<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => {
    assert_selection(
        '<div contenteditable>x|y</div>',
        'insertHTML <ul><li><div>one</div></li></ul>',
        '<div contenteditable>x<ul><li><div>one|</div></li></ul>y</div>',
        'insert list into text');

    assert_selection(
        [
            '<div contenteditable>',
                '<ul><li><div>Item |1</div></li></ul>',
            '</div>',
        ].join(''),
        'insertHTML <div>foo</div><div>bar</div>',
        [
            '<div contenteditable>',
                '<ul><li><div>Item foo</div><div>bar|</div></li><li><div>1</div></li></ul>',
            '</div>',
        ].join(''),
        'insert list into list');
});
</script>
